package cll;

import java.awt.*;



import javax.swing.*;
import static cll.Parameters.*;



public class Visuel extends JPanel{
	Environment envt;
	
	public Visuel(Environment envt){
		this.envt = envt;
	}
	public void paintComponent(Graphics g){
		
		for(Cell c : envt.cells){
			switch (c.type){
				case Centroblast : g.setColor(Color.pink);
				g.fillOval((int)(c.positionspeed.x), (int)(c.positionspeed.y), 10, 10);
						break;
				case Centrocyt : g.setColor(Color.magenta);
				g.fillOval((int)(c.positionspeed.x), (int)(c.positionspeed.y), 10, 10);break;
				case OutputCell : g.setColor(Color.red);
				g.fillOval((int)(c.positionspeed.x), (int)(c.positionspeed.y), 10, 10);break;
				
				
				case FollicularDendriticCell : g.setColor(Color.BLACK);
				g.fillRect((int)(c.positionspeed.x-1), (int)(c.positionspeed.y-15), 2, 30);
				g.fillRect((int)(c.positionspeed.x-15), (int)(c.positionspeed.y-1), 30, 2);break;
				case ReticularCell : g.setColor(Color.darkGray);
				g.fillRect((int)(c.positionspeed.x-1), (int)(c.positionspeed.y-15), 2, 30);
				g.fillRect((int)(c.positionspeed.x-15), (int)(c.positionspeed.y-1), 30, 2);break;
				
				case TCell : g.setColor(Color.blue);
				g.drawOval((int)(c.positionspeed.x), (int)(c.positionspeed.y), 5, 5);break;
				case THelper :  g.setColor(Color.CYAN);
				g.drawOval((int)(c.positionspeed.x), (int)(c.positionspeed.y), 5, 5);break;
				
				
				
			}
			
		}
		/*g.setColor(Color.black);
		for(int i = 0;i<tailleGC;i++){
			for(int j = 0;j<tailleGC;j++){
				//g.setColor(new Color((int)(envt.germinalCenter[i][j].getChemokine())));
				/*if (i%20==0 & j%20==0){
					g.drawString( ""+(int)(envt.germinalCenter[i][j].getChemokine()),200+i, j);
				}*/
				//g.drawRect(200+i, j, 5, 5);
				/*if (i%10==0 & j%10==0){
					double angle13 = Math.atan2(envt.germinalCenter[i][j].getGrady13(), envt.germinalCenter[i][j].getGradx13());
					g.drawLine((220+i), j, (int)(220+i+4*Math.cos(angle13)), (int)(j+4*Math.sin(angle13)));
					
					double angle12 = Math.atan2(envt.germinalCenter[i][j].getGrady12(), envt.germinalCenter[i][j].getGradx12());
					g.drawLine((450+i), j, (int)((450+i+4*Math.cos(angle12))), (int)((j+4*Math.sin(angle12))));
					
					double angle19 = Math.atan2(envt.germinalCenter[i][j].getGrady19(), envt.germinalCenter[i][j].getGradx19());
					g.drawLine((680+i), j, (int)((680+i+4*Math.cos(angle19))), (int)((j+4*Math.sin(angle19))));
				}
			
			}
		}*/
	}
}
	
		
